All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class quicktime.app.anim.SWController

java.lang.Object
   |
   +----quicktime.app.actions.MouseController
           |
           +----quicktime.app.anim.SWController

public class SWController
extends MouseController
The SWController deals with SpriteWorldHitTest calls on the SpriteWorld that is contained by the SWCompositor's sub classes. By default it will do hit testing on the actual sprite image itself. However, an application can set the hit-test flags to support any mode of hit testing appropriate.

See Also:
SWCompositor, SpriteWorld

Constructor Index

 o SWController(MouseResponder, boolean)
Construct a SWController object.
 o SWController(MouseResponder, boolean, int)
Construct a SWController object.

Method Index

 o deactivateResponder()
A method that is called whenever the MouseController deactivates its responder.
 o getFlags()
Returns the flags that control the hit test parameters on the SpriteWorld.
 o getSelected(MouseEvent)
This method is called when a MouseController has received a mouse event in its space.
 o getSpace()
Returns the current Space that the SWController is attached to.
 o responderActivated()
A notification method that is called whenever the MouseController activates its responder.
 o setFlags(int)
Set the flags for controlling the hit test behaviour of the SpriteWorld.
 o setTargetSpace(Space)
Sets the target Space of the MouseController.
 o setTranslation()
This method is used to setup translation values for x and y of an event to translate the event into the local coordinate space of a member's display Space.

Constructors

 o SWController
 public SWController(MouseResponder mr,
                     boolean wholeSpace)
Construct a SWController object.

Parameters:
mr - the Responder that will respond to mouse events when a sprite is hit.
wholeSpace - if true all object that are in the space will be dragged. If false then you must explicitly add the object to the controller.
 o SWController
 public SWController(MouseResponder mr,
                     boolean wholeSpace,
                     int flags)
Construct a SWController object.

Parameters:
mr - the Responder that will respond to mouse events when a sprite is hit.
wholeSpace - if true all object that are in the space will be dragged. If false then you must explicitly add the object to the controller.
flags - that will control the hit test parameters of the SpriteWorld

Methods

 o getSpace
 public Space getSpace()
Returns the current Space that the SWController is attached to. This space will be an instance of the SWCompositor class.

Returns:
the Space the controller is attached to.
Overrides:
getSpace in class MouseController
 o setTargetSpace
 protected void setTargetSpace(Space target)
Sets the target Space of the MouseController. This target must be a kind of SWCompositor class.

Parameters:
target - the potential target space for the SWController.
Overrides:
setTargetSpace in class MouseController
 o getFlags
 public int getFlags()
Returns the flags that control the hit test parameters on the SpriteWorld.

 o setFlags
 public void setFlags(int flags)
Set the flags for controlling the hit test behaviour of the SpriteWorld.

 o deactivateResponder
 protected void deactivateResponder()
A method that is called whenever the MouseController deactivates its responder. A subclass should use this method to deactivate a responder (either explicitly or calling super.deactivateResponder). For example a user may have dragged a member out of a group, so the drag action's target is no longer valid and the Responder has no target to act upon.

Overrides:
deactivateResponder in class MouseController
 o responderActivated
 protected void responderActivated()
A notification method that is called whenever the MouseController activates its responder.

Overrides:
responderActivated in class MouseController
 o setTranslation
 protected void setTranslation()
This method is used to setup translation values for x and y of an event to translate the event into the local coordinate space of a member's display Space. In the case of a DirectGroup the translation is (0, 0), in the case of a Compositor member (which can be embedded n-deep) the translation is the sum of the locations of the space's parents.

The method sets the value of the protected instance variables xLocationOffset and yLocation offset.

Overrides:
setTranslation in class MouseController
 o getSelected
 protected Object getSelected(MouseEvent event) throws QTException
This method is called when a MouseController has received a mouse event in its space. This method returns a TwoDSprite object if the SpriteWorld.hitTest method returns a Sprite at the event's location.

Parameters:
event - a mouse down event
Returns:
a TwoDSprite object that is located at the event coordinates or null if no Sprite at the location of the event.
Overrides:
getSelected in class MouseController

All Packages  Class Hierarchy  This Package  Previous  Next  Index